home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Essentials / MacApp Documentation / MacApp.TECH$ Archives / 1991 / MacApp Apr 91 / MacApp.Tech$ 4⁄12⁄91 / 3422-MAOpenFile bug with -Apr91 < prev    next >
Encoding:
Text File  |  1991-04-29  |  2.5 KB  |  82 lines  |  [TEXT/GEOL]

  1. Item    1463472                         8-April-91        19:26PDT
  2.  
  3. From:   AUST0338                        AUPtnr - Tactics Int'l,Shillito,IDV
  4.  
  5. To:     APPLE.BUGS                      Apple Bugs Reporting
  6.  
  7. cc:     MACAPP.TECH$                    MacApp Technical
  8.  
  9. Item forwarded by       BOWMAN       to TRAMMEL1 
  10.  
  11. ------------------------------------------------------------------------------
  12.  
  13. Sub:    MAOpenFile bug with ISO CD
  14.  
  15. To:         APPLE.BUGS
  16. Cc:         MACAPP.TECH$
  17. From:       AUST0338 - David Shillito
  18. Date:       9th April 1991
  19.  
  20. Subject:    MAOpenFile bug with ISO CD
  21.  
  22. MAOpenFile, which is called during the implementation of the Open command in
  23. MacApp, seems to have a problem opening files residing on an ISO 9660 CD. Even
  24. though it is being called with dataPerm set to fsRDPerm, ie. requesting read
  25. access only, it is returning error code -44 which means "diskette is write
  26. protected".
  27.  
  28. I have tracked this down to the following call to PBHOpenDeny
  29.  
  30.    IF qNeedsROM128K | gConfiguration.hasHFS THEN
  31.    result := PBHOpenDeny(@pb, FALSE)   { Try the shared volume open. }
  32.    ELSE
  33.    result := paramErr;
  34.  
  35.    IF result = paramErr THEN   { Not on a shared volume, try HFS open. }
  36.    BEGIN
  37.    pb.ioPermssn := BAND(dataPerm, 3);
  38.    result := PBHOpen(@pb, FALSE);
  39.    END;
  40.    TestForError(result);
  41.  
  42. I cured the problem, by checking for the new error code as follows:
  43.  
  44.    IF qNeedsROM128K | gConfiguration.hasHFS THEN
  45.    result := PBHOpenDeny(@pb, FALSE)   { Try the shared volume open. }
  46.    ELSE
  47.    result := paramErr;
  48.  
  49.    IF (result = paramErr) |{ JDS 910409 - ISO CD returns wPrErr }
  50.    (result = wPrErr) THEN  { Not on a shared volume, try HFS open. }
  51.    BEGIN
  52.    pb.ioPermssn := BAND(dataPerm, 3);
  53.    result := PBHOpen(@pb, FALSE);
  54.    END;
  55.    TestForError(result);
  56.  
  57.  
  58. While investigating the above bug I also noticed, in the same procedure, that
  59. the parameter block for PBHOpenDeny does not seem to be set up correctly. The
  60. pb.ioPermssn field is being set up although it will not be used and the
  61. pb.ioDenyModes field, which is required for PBHOpenDeny, is not being setup. I
  62. suggest the following code:
  63.  
  64.    WITH pb DO
  65.    BEGIN
  66.    ioNamePtr := @name;
  67.    ioVRefnum := volRefnum;
  68.    ioVersNum := 0;
  69.    CASE dataPerm OF{ JDS 910409 }
  70.    fsRdPerm:   ioDenyModes := 1;
  71.    fsWrPerm:   ioDenyModes := 2;
  72.    fsRdWrPerm: ioDenyModes := 1+2+16+32;
  73.    fsRdWrShPerm:   ioDenyModes := 1+2;
  74.    OTHERWISE   ioDenyModes := 1+2; {???}
  75.    END {CASE};
  76.    ioMisc := NIL;
  77.    END;
  78.  
  79.  
  80. David Shillito
  81.  
  82.